package main

import (
	"gin-admin/global"
	"gin-admin/initialize"
	"gin-admin/model"
	"gin-admin/router"

	"go.uber.org/zap/zapcore"
)

// @title GinAdmin接口文档
// @version 1.0
// @description 这是GinAdmin项目的接口文档
// @host localhost:8080
// @BasePath /
func main() {
	initialize.InitializeViper()
	initialize.InitializeLogger(zapcore.DebugLevel)
	initialize.InitializeDB()
	defer initialize.CloseDB()
	initialize.InitializeRedis()
	global.GA_DB.AutoMigrate(&model.User{})
	global.GA_DB.AutoMigrate(&model.Role{})
	global.GA_DB.AutoMigrate(&model.UserRole{})
	global.GA_DB.AutoMigrate(&model.Menu{})
	global.GA_DB.AutoMigrate(&model.RoleMenu{})
	initialize.InitializeRouter()
	router.Run()
}
